package com.music.service.playlists.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Required;

import com.music.service.playlists.beans.Playlist;
import com.music.service.playlists.dao.PlaylistDAO;
import com.music.service.songs.beans.Song;
import com.music.service.urls.beans.Url;

public class PlaylistServiceImpl implements PlaylistService {
	private PlaylistDAO mPlaylistDAO;

	
	/**
	 * @return PlaylistDAO
	 */
	public PlaylistDAO getPlaylistDAO() {
		return mPlaylistDAO;
	}

	/**
	 * @param pPlaylistDAO
	 */
	@Required
	public void setPlaylistDAO(PlaylistDAO pPlaylistDAO) {
		mPlaylistDAO = pPlaylistDAO;
	}

	
	
	public List<Playlist> viewPlaylists(Long pMemberId) {
		return getPlaylistDAO().viewPlaylists(pMemberId);
	}

	public void addSongToPlaylist(Long pMemberId,Playlist pPlaylistId,String pSongName,String pSongUrl){
		
	}
	
	public List<Playlist> getRecentPlaylists(Long pMemberId, int pSize) {
		return getPlaylistDAO().getRecentPlaylists(pMemberId, pSize);
	}

	
	public Playlist getPlaylistInfoForMember(Long pMemberId, Long pPlaylistId) {
		return getPlaylistDAO().getPlaylistInfoForMember(pMemberId, pPlaylistId);
	}

	
	public Playlist addPlaylist(Playlist pPlaylist) {
		return getPlaylistDAO().addPlaylist(pPlaylist);
	}

	
	public void addSongToPlaylist(Playlist pPlaylist, Song pSong) {
		 getPlaylistDAO().addSongToPlaylist(pPlaylist, pSong);
	}

	
	public void deletePlaylist(Playlist pPlaylist) {
		 getPlaylistDAO().deletePlaylist(pPlaylist);
	}

	
	public void deleteSongFromPlaylist(Playlist pPlaylist, Song pSong) {
		 getPlaylistDAO().deleteSongFromPlaylist(pPlaylist, pSong);	
	}

	public Playlist editPlaylist(Playlist pPlaylist) {
		return getPlaylistDAO().editPlaylist(pPlaylist);
		
	}

	public Song addSongToPlaylist(Playlist pPlaylist, Song pSong, Url pUrl) {
		return getPlaylistDAO().addSongToPlaylist(pPlaylist, pSong, pUrl);
		
	}

		
}
